<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>首页</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/lib/layui/css/layui.css">
	<style type="text/css">  
	.layui-table-page {  
		position:fixed;  
	}  
	</style>
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">票据管理系统</div>
		</div>
		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<div title="菜单缩放" class="kit-side-fold"><i class="layui-icon layui-icon-spread-left" aria-hidden="true">菜单缩放</i></div>
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" lay-filter="test">
					<c:if test="${userInfo.roleId==0 || userInfo.roleId==1 }">
						<li class="layui-nav-item layui-nav-itemed"><a class=""
							href="javascript:;">财务菜单</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="finance/goToQuery" target="indexIframe">历史批次查询</a>
								</dd>
								<dd>
									<a href="finance/goToQueryCount" target="indexIframe">历史总数查询</a>
								</dd>
								<c:if test="${userInfo.roleId==0 }">
									<dd>
										<a href="finance/goToQueryByArea" target="indexIframe">卖票统计（区域）</a>
									</dd>
									<dd>
										<a href="finance/goToQueryByType" target="indexIframe">卖票统计（类型）</a>
									</dd>
								</c:if>
								<dd>
									<a href="finance/goToAddNumber" target="indexIframe">发票录入</a>
								</dd>
							</dl></li>
					</c:if>
					<c:if test="${userInfo.roleId==0 || userInfo.roleId==2}">
						<li class="layui-nav-item"><a href="javascript:;">数据分析员</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="dataAnalyze/goToQueryByArea" target="indexIframe">区域查询</a>
								</dd>
								<dd>
									<a href="dataAnalyze/goToQueryByUnit" target="indexIframe">车辆所属</a>
								</dd>
								<dd>
									<a href="dataAnalyze/goToQueryByType" target="indexIframe">类型查询</a>
								</dd>
								<dd>
									<a href="dataAnalyze/goToCarAreaManage" target="indexIframe">区域车牌维护</a>
								</dd>
								<dd>
									<a href="dataAnalyze/goToCarCompanyManage" target="indexIframe">公司车牌维护</a>
								</dd>
								<dd>
									<a href="dataAnalyze/goToQueryBySynthesis" target="indexIframe">综合查询</a>
								</dd>
								<dd>
									<a href="dataAnalyze/goToQueryByCarNo" target="indexIframe">车牌查询</a>
								</dd>
								<!-- <dd>
									<a href="dataAnalyze/goToQuery" target="indexIframe">类型动态展示</a>
								</dd> -->
							</dl></li>
					</c:if>
					<c:if test="${userInfo.roleId==4}">
						<li class="layui-nav-item"><a href="/pwd/goToDistribute"
							target="indexIframe">分发密码</a></li>
						<li class="layui-nav-item"><a href="/pwd/goToReceive"
							target="indexIframe">编辑跟车人</a></li>
					</c:if>
					<c:if test="${userInfo.roleId==4}">
						<li class="layui-nav-item"><a href="/pwd/goToPwdDetails"
							target="indexIframe">密码使用详情</a></li>
					</c:if>
					<c:if test="${userInfo.roleId==0}">
						<li class="layui-nav-item"><a href="/pwd/goToLeaderPwdDetails"
							target="indexIframe">密码使用详情</a></li><!-- (领导) -->
					</c:if>
					<c:if test="${userInfo.roleId==0}">
						<li class="layui-nav-item"><a href="/finance/goToEdit"
							target="indexIframe">发票数量维护</a></li>
					</c:if>
					<c:if test="${userInfo.roleId==0 || userInfo.roleId==5}">
						<li class="layui-nav-item"><a href="/gather/goToSubmit"
							target="indexIframe">现场收票</a></li>
					</c:if>
					<li class="layui-nav-item"><a href="/goToUpdatePwd"
							target="indexIframe">修改密码</a></li>
					<li class="layui-nav-item"><a href="/quit">退出</a></li>
				</ul>
			</div>
		</div>
		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 10px; height: 80%">

				<iframe id="indexIframe" name="indexIframe" src="${src}"
					width="100%" height="100%" frameborder="no" border="0"
					marginwidth="0" marginheight="0" scrolling="no"
					allowtransparency="yes"></iframe>

			</div>
		</div>
		<div class="layui-footer">
			<!-- 底部固定区域 -->
			版权所属:上海胜收电子科技有限公司
		</div>
	</div>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script src="${pageContext.request.contextPath}/lib/layui/layui.all.js"></script>
	
	
	<script>
	var isShow = true;  //定义一个标志位
    $('.kit-side-fold').click(function(){
        //选择出所有的span，并判断是不是hidden
        $('.layui-nav-item span').each(function(){
            if($(this).is(':hidden')){
                $(this).show();
            }else{
                $(this).hide();
            }
        });
        //判断isshow的状态
        if(isShow){
            $('.layui-side.layui-bg-black').width(60); //设置宽度
            $('.kit-side-fold i').css('margin-right', '70%');  //修改图标的位置
            //将footer和body的宽度修改
            $('.layui-body').css('left', 60+'px');
            $('.layui-footer').css('left', 60+'px');
            //将二级导航栏隐藏
            $('dd span').each(function(){
                $(this).hide();
            });
            //修改标志位
            isShow =false;
        }else{
            $('.layui-side.layui-bg-black').width(200);
            $('.kit-side-fold i').css('margin-right', '10%');
            $('.layui-body').css('left', 200+'px');
            $('.layui-footer').css('left', 200+'px');
            $('dd span').each(function(){
                $(this).show();
            });
            isShow =true;
        }
    });
	
	</script>
</body>
</html>